package com.shawn.integeration.business.usermanager.controller;

import com.shawn.integeration.business.usermanager.model.User;
import com.shawn.integeration.common.model.res.GenericResponse;
import com.shawn.integeration.ratelimiter.annonation.RateLimiter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户管理控制层
 *
 * @author: shawn
 * @Date: 2023/12/28 11:12
 * @Version 1.0.0
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @RateLimiter
    @GetMapping("/select/{id}")
    public GenericResponse<User> selectUser(@PathVariable("id") Long id) {
        User user = new User();
        user.setId(id);
        user.setName("shawn");
        user.setAge(20);
        user.setEmail("shawn@163.com");
        user.setAddress("china");
        return GenericResponse.success(user);
    }
}
